package com.geetour.columbus.common.test.mysql;

import java.sql.Connection;

import org.dbunit.DatabaseUnitException;
import org.dbunit.database.DatabaseConfig;
import org.dbunit.database.DatabaseConnection;
import org.dbunit.ext.mysql.MySqlDataTypeFactory;

/**
 * Oracle Database Connection
 *
 * @author ChenKai
 * @since 2012-05-09
 */
public class MysqlDatabaseConnection extends DatabaseConnection {

	public MysqlDatabaseConnection(Connection connection)
			throws DatabaseUnitException {
		this(connection, null);

	}

	public MysqlDatabaseConnection(Connection connection, String schema) throws DatabaseUnitException {
		super(connection, schema != null ? schema.toUpperCase() : null);
        getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, TYPE_FACTORY );
	}

	private static final MySqlDataTypeFactory TYPE_FACTORY = new MySqlDataTypeFactory();
}
